
import 'dart:math';

import 'package:flutter/material.dart';

class CirclePainter extends CustomPainter {
  
  Paint outerPaint = Paint()
  ..isAntiAlias = true;


  Paint innerPaint = Paint()
  ..strokeWidth = 2
  ..style = PaintingStyle.stroke
    ..color = Colors.green
    ..isAntiAlias = true;

  
  @override
  void paint(Canvas canvas, Size size) {
    outerPaint.color = Colors.red;
    outerPaint.style = PaintingStyle.stroke;
    outerPaint.strokeWidth = 10;
    canvas.drawArc(Rect.fromLTRB(10, 10, 100, 100), _degreesToRadians(-180), _degreesToRadians(-180), false, outerPaint);
    
    //canvas.drawArc(Rect.fromLTWH(140, 40, 100, 100), -90, 20, false, innerPaint);

    Path path = Path();
    path.moveTo(140, 60);
    path.lineTo(150, 80);

    canvas.drawPath(path, innerPaint);

  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }

  double _degreesToRadians(double angle) => angle * pi / 180.0;

}